# 1.私有成员变量
class Person:
    __name = "张三"
    __age = 18
    __weight = 60
    __height = 170
    __salary = 10000
    __is_married = True
    __is_boy = False
    __is_girl = True

    # 2.构造函数
    def __init__(self):
        self.__name = "李四"
        self.__age = 20
        self.__weight = 70
        self.__height = 180
        self.__salary = 15000
        self.__is_married = False
        self.__is_boy = True
        self.__is_girl = False

   # 公有成员函数
    def getSalary(self):
        return self.__salary
    def setSalary(self, salary):
        self.__salary = salary

    #getter和setter
    def setName(self, name):
        self.__name = name
    
    def getName(self):
        return self.__name

    def getWeight(self):
        return self.__weight
    
    def setWeight(self, weight):
        self.__weight = weight

    def getAge(self):
        return self.__age
    
    def setAge(self, age):
        self.__age = age

    def getIsMarried(self):
        return self.__is_married
    
    def setIsMarried(self, is_married):
        self.__is_married = is_married
        if self.__is_married:
            print("您已结婚")
        else:
            print("您未婚")
    
    def getIsBoy(self):
        return self.__is_boy

    def setIsBoy(self, is_boy):
        self.__is_boy = is_boy
        if self.__is_boy:
            print("您是男的")
        else:
            print("您是女的")    
    
    def getIsGirl(self):
        return self.__is_girl
    
    def setIsGirl(self, is_girl):
        self.__is_girl = is_girl
    
    def getInfo(self):
        print("姓名：", self.__name)
        print("年龄：", self.__age)
        print("体重：", self.__weight)
        print("身高：", self.__height)
        print("工资：", self.__salary)
        print("婚姻状况：", self.__is_married)
        print("性别：", self.__is_boy)
        print("性别：", self.__is_girl)


p = Person()
p.getInfo()
p.setName("王五")
p.getInfo()
p.setAge(25)
p.getInfo()
p.setWeight(80)
p.getInfo()
p.setSalary(20000)
p.getInfo()
p.setIsMarried(True)
p.getInfo()
p.setIsBoy(False)
p.getInfo()
p.setIsGirl(True)
p.getInfo()

